Here are the instructions for adding a new game sound effect to a particular game event.

The bomb blast sound is used as an example.\hypertarget{add_new_sound_effect_createSoundFileAndAddToResources}{}\section{Creating the File and Adding the File to Resources}\label{add_new_sound_effect_createSoundFileAndAddToResources}
When adding a new sound effect you must have a new sound file and the file must be added to resources. See how to do this in section \hyperlink{replacing_sound_effect_createSoundEffectFile}{Creating a Sound Effect File}.

The created sound file is added to the resources. See how to do this from section \hyperlink{replacing_sound_effect_addSoundEffectFileToResources}{Adding the Sound Effect File to Resources}.\hypertarget{add_new_sound_effect_useSoundEffectFromGameEngine}{}\section{Using the Sound Effect from the GameEngine}\label{add_new_sound_effect_useSoundEffectFromGameEngine}
Next thing is to add a new sound effect type. Type is added to the enum SoundEffectType: 
\begin{DoxyCode}
    ...
        SoundBlast = 3,
    ...
\end{DoxyCode}
 Next the new sound effect must be loaded to \hyperlink{class_sound_engine}{SoundEngine}. This is done at the \hyperlink{class_sound_engine}{SoundEngine} constructor \hyperlink{class_sound_engine_a2253b41298fb1e82ed7b8afc7969e1d6}{SoundEngine::SoundEngine}. The \hyperlink{class_sound_engine_af0d71ffcfc0d7af7767b0c73358bca12}{SoundEngine::loadFile()} method is used to load the file from the resources to the sound engine: 
\begin{DoxyCode}
    ...
    loadFile(SoundBlast, ":/sounds/blast.wav");
    ...
\end{DoxyCode}


After this the new SoundBlast \hyperlink{class_sound_effect}{SoundEffect} can be used through the \hyperlink{class_game_engine}{GameEngine}. The new sound effect is played by creating a new \hyperlink{class_sound_effect}{SoundEffect} with a given SoundEffectType by using the \hyperlink{class_game_engine_aab41e253c31468827fb83e6b333a42f2}{GameEngine::newSoundEffect} method.

To the \hyperlink{class_game_engine_a9c68acd3f416ff54a494c2f85edfea26}{GameEngine::launchBomb} method, new code needs to be added to play the SoundBlast effect: 
\begin{DoxyCode}
    ...
    if (soundEngine != NULL)
        newSoundEffect(SoundBlast);
    ...
\end{DoxyCode}


Finally when the GameEffects are handled at the end of the \hyperlink{class_game_engine_a0cb4c8cd0289b828d85588f68e728153}{GameEngine::cycleGameLoop} using the method \hyperlink{class_game_engine_a4082ada6ed021d5dbc87bac033d4a70b}{GameEngine::processNewEffects}, the \hyperlink{class_sound_engine}{SoundEngine} is used to play the \hyperlink{class_sound_effect}{SoundEffect}. 